package com.softtown.modules.workflow.service.impl;

import com.softtown.common.service.impl.BaseServiceImpl;
import com.softtown.modules.workflow.dao.SwfHstAprvDao;
import com.softtown.modules.workflow.dto.SwfHstAprvDTO;
import com.softtown.modules.workflow.entity.SwfHstAprvEntity;
import com.softtown.modules.workflow.service.SwfHstAprvService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: Dingyayong
 * @Date: 2019/8/22 15:18
 * @Description:
 */
@Service
public class SwfHstAprvServiceImpl extends BaseServiceImpl<SwfHstAprvDao, SwfHstAprvEntity> implements SwfHstAprvService {

    /**
     * 获取待我审批中的审批历史
     *
     * @param swfHstAprvDTO 审批任务DTO
     * @return java.util.List<com.softtown.modules.entity.SwfHstAprvEntity>
     * @Author Dingyayong
     * @Date 2020/4/13 17:41
     */
    @Override
    public List<SwfHstAprvEntity> getswfHstAprvList(SwfHstAprvDTO swfHstAprvDTO) {
        return baseDao.getswfHstAprvList(swfHstAprvDTO.getCompId(), swfHstAprvDTO.getApplId(), swfHstAprvDTO.getProcInstId());
    }

    /**
     * 获取待我审批中的审批历史
     *
     * @param compId     公司id
     * @param applId     申请单id
     * @param procInstId 审批实例id
     * @return java.util.List<com.softtown.modules.entity.SwfHstAprvEntity>
     * @Author Dingyayong
     * @Date 2020/4/13 17:42
     */
    @Override
    public List<SwfHstAprvEntity> getSwfHstAprvListByPdf(Long compId, Long applId, Long procInstId) {
        SwfHstAprvEntity swfHstAprvEntity = baseDao.getswfHstAprvByProc(compId, applId, procInstId);
        return baseDao.getswfHstAprvPdfList(compId, applId, procInstId, swfHstAprvEntity.getDealDate());
    }
}
